import { Loader2 } from "lucide-react";
import "./style.less";

interface ViewAreaProps {
  videoSrc?: string;
  isGenerate?: boolean;
}

export const VideoArea = (props: ViewAreaProps) => {
  const { videoSrc, isGenerate } = props;
  return (
    <div className="videoArea">
      {isGenerate && (
        <div className="inline-flex">
          <Loader2 className="animate-spin mr-4 h-5 w-5 text-[#6FEBF4]" />
          正在生成...
        </div>
      )}
      {!isGenerate &&
        (videoSrc ? (
          <video src={videoSrc} controls className="w-full h-full" />
        ) : (
          "AI生成视频内容"
        ))}
    </div>
  );
};
